package wsz.autodeliver.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import wsz.autodeliver.client.fallback.ResumeFallBack;

/**
 * Feign调用接口
 * @author wsz
 * @date 2021/12/24 17:01
 **/
@FeignClient(name = "service-resume", fallback = ResumeFallBack.class, path = "/resume")
// 使用fallback时，@RequestMapping的url前缀值，可以改为在@FeignClient的path属性
//@RequestMapping("/resume")
public interface ResumeFeignClient {

    /**
     * @PathVariable/@equestParam/@RequestHeader必须设置value
     * @param userId
     * @return
     */
    @RequestMapping(value = "openstate/{userId}", method = RequestMethod.GET)
    Integer findDefaultResumeState(@PathVariable(value = "userId") Long userId);
}
